package br.com.bmb.monitorimoveis.persistencia;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import br.com.bmb.monitorimoveis.entidade.InfoColeta;
import br.com.bmb.monitorimoveis.persistencia.impl.AbstractDAO;

@Service
public class InfoColetaDAO extends AbstractDAO<InfoColeta, Long> implements IInfoColetaDAO {	
	
	
	public void atualizar(InfoColeta infoColeta) {
		getSession().merge(infoColeta);
	}
	

	@SuppressWarnings("unchecked")
	public List<InfoColeta> listarPendentes() {
		Criteria criteria = getSession().createCriteria(InfoColeta.class);
		criteria.add(Restrictions.eq("coletado", false));
		criteria.setMaxResults(10500);
		return criteria.list();
	}


	@Override
	protected  Class<?> getObjectType() {
		return InfoColeta.class;
	}
	
	


}
